package nix.ssh.action;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import nix.ssh.domain.User;
import nix.ssh.service.UserService;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport {

	private UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public String list() {
		DetachedCriteria dc = DetachedCriteria.forClass(User.class);
		List<User> list = this.userService.getPageList(dc, 0, 10);
		ActionContext.getContext().put("list", list);
		return "list";
	}
}
